FROM debian:13.1-slim
LABEL author=xiaoyilin
LABEL email=406735078@qq.com
ENV TZ=Asia/Shanghai
ARG S_V
ADD  syncthing-linux-amd64-v$S_V.tar.gz /usr/local/
ENV PATH=/usr/local/syncthing-linux-amd64-v$S_V:$PATH
WORKDIR /usr/local/syncthing-linux-amd64-v$S_V
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \
apt-get -y update && apt-get -y upgrade && apt-get -y install ca-certificates && \
syncthing generate --home=/usr/local/syncthing  --gui-user=xiaoyilin --gui-password=xiaoyilin
ENTRYPOINT ["syncthing"]
CMD ["--gui-address","0.0.0.0:8384","--home","/usr/local/syncthing"]
# https://docs.syncthing.net/intro/getting-started.html
# docker build --build-arg S_V=2.0.10 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/syncthing:2.0.10 .
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/syncthing:2.0.10
# docker run --rm -p 8384:8384 registry.cn-hangzhou.aliyuncs.com/xiaoyilin/syncthing:2.0.10
# docker run -d -p 8384:8384 registry.cn-hangzhou.aliyuncs.com/xiaoyilin/syncthing:2.0.10
# docker run -p 8384:8384 --rm -it registry.cn-hangzhou.aliyuncs.com/xiaoyilin/syncthing:2.0.10 bash
# syncthing  serve --help
# syncthing  serve --paths
# syncthing  generate --help
# syncthing  decrypt  --help
# syncthing  --gui-address="0.0.0.0:8384" --home=/usr/local/syncthing
# /root/Sync